package perso.android.savethemage.v1;

import org.andengine.entity.modifier.RotationModifier;
import org.andengine.entity.modifier.ScaleAtModifier;
import org.andengine.extension.physics.box2d.PhysicsWorld;

import android.util.Log;

public class SortBouleQuiRoule extends ASort{

	public SortBouleQuiRoule(int nbMaxMechantCroise, SortPossible sortP){
		super.instancier(nbMaxMechantCroise, sortP);
	}
	
	
	@Override
	public void appli(final PhysicsWorld mPhysicsWorld) {
		super.appli(mPhysicsWorld);
		
		this.face.registerEntityModifier(new ScaleAtModifier(1.3f , 0.1f, 1, this.sizeSort, this.sizeSort ));
		//this.face.setAlpha(0.3f);
		this.face.registerEntityModifier(new RotationModifier(20, 1, 2800));
	}
	
	@Override
	public void effet(AMechant mechant, GameActivity svtm) {
		Log.e("Misa.SavaTheMage", "Boum, collision");
		if(mechant instanceof MechantDeBase){
			mechant.vie = mechant.vie - 80;
		/*} else if(mechant instanceof MechantD){
			
		} else if(mechant instanceof MechandD){
		*/
		} else {
			Log.e("Misa.Entite", "Aucun effet sur le monstre!!!");
		}
		if(mechant.vie <= 0)
			svtm.destruction(mechant);
	}
}
